<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const arr = [
            {
                name:'大数据',
                id:1
            },
            {
                name:'大数据',
                id:2
            },
            {
                name:'大',
                id:3
            },
            {
                name:'大数据',
                id:4
            }
        ]
        // const newArr = []
        // arr.forEach(item=>{
        //     if (!newArr.find(value=>value.name === item.name)) {
        //         newArr.push(item)
        //     }
        // })
        const newarr = arr.filter((item,index,array)=>index === array.findIndex(value.name===item.name))
        console.log(newarr);
    </script>
</body>
</html>